import request from '@/utils/http/uni-ajax';

/** 权限模块URL枚举 */
const Api = {
	/** 检查URL授权 */
	CheckUrlAuth: '/api/auth/checkurlauth',
	/** 获取授权信息 */
	GetAuthInfo: '/api/auth/getauthinfo',
}

/**
 * 检查URL授权
 * @param url 要检查的URL
 * @param mode 错误消息模型
 */
export function checkUrlAuth(url, mode = 'none') {
	return request.get({
		url: Api.CheckUrlAuth,
		query: {
			url: url
		},
		requestOptions: {
			errorMessageMode: mode
		}
	});
}

/**
 * 获取授权信息
 * @param mode 错误消息模型
 */
export function getAuthInfo(mode = 'none') {
	return request.get({
		url: Api.GetAuthInfo,
		requestOptions: {
			errorMessageMode: mode
		}
	});
}
